#define _CRT_SECURE_NO_WARNINGS 1
#include "Snake.h"
void Game()
{
	//创建贪吃蛇
	Snake snake = { 0 };
	char ch = '0';
	do
	{
		system("cls");
		//游戏初始化
		GameInit(&snake);
		//游戏运行
		GameRun(&snake);
		//游戏结束
		//善后工作
		Gameover(&snake);
		Sleep(1000);
		system("cls");
		GetPos(50, 16);
		printf("是否继续（Y/N）");
		scanf("%c",&ch);
	} while (ch == 'y' || ch == 'Y');
}

int main()
{
	//程序运行之前先进行本地化
	setlocale(LC_ALL,"");
	srand((unsigned)time(NULL));

	Game();
	system("cls");
	GetPos(50, 16);
	printf("退出游戏");
	GetPos(54, 36);

	return 0;
}